import App from './App'
import {
	defineAsyncComponent
} from 'vue'
// 引入 uView UI
import uView from './uni_modules/vk-uview-ui';

import store from './store'
import util from './utils/index.js'
import {
	createI18n
} from 'vue-i18n'
import en from './18n/en.js'
import zh from './18n/zh.js'
import kh from './18n/kh.js'
import {
	createSSRApp
} from 'vue'
const i18n = createI18n({
	legacy: false,
	locale: 'zh',
	messages: {
		zh,
		en,
		kh
	}
})
import tabBar from './components/tabBar.vue'
import InputArea from './components/inputarea.vue'
import uploader from './components/uploader.vue'
import sm from './components/sm.vue'
 
import Type from "./pages/publish/components/Type.vue";
import Status from "./pages/publish/components/Status.vue";
import Picture from "./pages/publish/components/Picture.vue";
import Price from "./pages/publish/components/Price.vue";
import Hose from "./pages/publish/components/Hose.vue";
import Feature from "./pages/publish/components/Feature.vue";
import Desc from "./pages/publish/components/Desc.vue";
import Area from "./pages/publish/components/Area.vue";

import userHead from "@/pages/user/components/userHead.vue";
import account from "@/pages/user/components/account.vue";
import accountList from "@/pages/user/components/accountList.vue";
import feedback from "@/pages/user/components/feedback.vue";
import iconText from "@/pages/user/components/iconText.vue";

import headinfo from "@/pages/search/components/headinfo.vue";
import priceinfo from "@/pages/search/components/priceinfo.vue";
import infos from "@/pages/search/components/infos.vue";
import imgs from "@/pages/search/components/imgs.vue";
import popStep from  "@/pages/search/components/popStep.vue";
import popIdentify from  "@/pages/search/components/popIdentify.vue";
import homeHead from "@/pages/home/components/homeHead.vue";

const __GLOBAL__DEBUG__WX__ = false

export function createApp() {
	const app = createSSRApp(App)
	app.use(store)
	app.use(uView)
	app.use(i18n)
    
	app.component('tabBar',tabBar)
	app.component('InputArea',InputArea)
	app.component('uploader',uploader)
	app.component('sm',sm)
	
	app.component('Type',Type)
	app.component('Status',Status)
	app.component('Picture',Picture)
	app.component('Price',Price)
	app.component('Hose',Hose)
	app.component('Feature',Feature)
	app.component('Desc',Desc)
	app.component('Area',Area)
	
	app.component('userHead',userHead)
	app.component('account',account)
	app.component('accountList',accountList)
	app.component('feedback',feedback)
	app.component('iconText',iconText)
	
	app.component('headinfo',headinfo)
	app.component('priceinfo',priceinfo) 
	app.component('infos',infos)
	app.component('imgs',imgs)
	app.component('popIdentify',popIdentify)
	app.component('popStep',popStep)
	
	
	app.component('homeHead',homeHead)
	
	Object.assign(app.config.globalProperties, util)
	return {
		app
	}
}
